 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.wy17113.model.entity.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	List allCommons = (List) request.getAttribute("allCommons");
	String pageStr = (String) request.getAttribute("pageStr");
	String infoId = (String) session.getAttribute("infoId");
	int allCounts = (Integer)request.getAttribute("allCounts");
	LifeInfo lifeInfo = (LifeInfo) request.getAttribute("lifeInfo");
	
	if(null == infoId){
		infoId = "";
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>评论管理</title>
		<link REL="stylesheet" TYPE="text/css" HREF="style.css">
<script>
	function getLifeInfoList(pageNum) {
		window.location.href = "doLifeInfo.do?opers3=getCommonListByInfoId&flag=1&infoId=" + document.forms[0].infoId.value + "&pageNum=" + pageNum;
	}
	
	function SetAllCheck(formObj, checkName) {
		var obj = eval("formObj." + checkName + ";");
		if (obj != null)
			for ( var i = 0; i < obj.length; i++) {
				obj[i].checked = formObj.allOper.checked;
			}
	}
	
	function GoPage() {
		document.forms[0].action = "doLifeInfo.do?opers3=getCommonListByInfoId&flag=1&infoId=" + document.forms[0].infoId.value;
		document.forms[0].submit();
	}
	
	function DoOperateDelete() {
		document.forms[0].action = "doLifeInfo.do?opers3=deleteCommon";
		if (confirm("确定要执行该操作吗？删除之后不可恢复！")) {
			document.forms[0].submit();
		} else {
			return;
		}
	}
</script>

<script type="text/javascript" src="js/lhgcore.js"></script>
<script type="text/javascript" src="js/lhgcalendar.js"></script>

	</head>

	<body text="#000000" leftmargin="0" topmargin="7" bgcolor="#FFFFFF">
		<table width="770" border="0" cellspacing="0" cellpadding="0"
			align="center">
			<tr>
				<td background="img/list-bg.jpg" valign="top">
					<br>
					<br>
					<form method="post" action="">
						<table width="80%" border="0" cellspacing="0" cellpadding="0"
							align="center">
							<tr>
								<td>
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="60%">
												按生活信息编号查询：<input type="text" name="infoId" id="infoId" size="31" value="<%=infoId %>"/>												
												&emsp;&emsp;
												<input type="button" name="Submit" value=" 查 询 " onClick="GoPage()">
											</td>
											<td align="right" valign="bottom">
												[
												<a href="admin/adminIndex.jsp"
													style="font-size: 12pt; color: #000099">返回控制台</a>]
											</td>
										</tr>
										<tr>
											<td colspan="2" bgcolor="B4B4B4" height="15"></td>
										</tr>										
									</table>
								</td>
							</tr>

							<tr>
								<td>
									<table width="1000px" border="1" cellspacing="0" cellpadding="1">
										<tr align="center">
											<td bgcolor="#EFF8E0" height="25" class=text width="50">
												选中
											</td>
											<td bgcolor="#EFF8E0" height="25" class=text width="100">
												楼层
											</td>
											<td width="40" height="25" bgcolor="#EFF8E0" width="100">
												发布时间
											</td>
											<td bgcolor="#EFF8E0" height="25" class=text width="100">
												内容
											</td>
										</tr>
										<c:forEach var="com" items="<%=allCommons %>">
											<tr align="center">
												<td bgcolor="#FFFFFF" width="50">
													<input type="checkbox" name="commonIDList" id="commonIDList"  value="${com.id}">
												</td>
												<td bgcolor="#FFFFFF" width="100">
													${com.sort}
												</td>
												
												<td bgcolor="#FFFFFF" width="100" align="center">
													${com.subDate}
												</td>												
												<td bgcolor="#FFFFFF" width="150" align="left">
													${com.content}
												</td>
											</tr>
										</c:forEach>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="1" cellspacing="1" cellpadding="0"
										bgcolor="737373" bordercolor="#FFFFFF">
										<tr>
											<td>
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td bgcolor="B4B4B4" height="20" align="center">
															<%=pageStr %>
														</td>
														<td bgcolor="B4B4B4" height="20" align="right">
															[总记录数：<%=allCounts %>]
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td>
												<input type="checkbox" name="allOper"
													onClick="SetAllCheck(this.form, 'commonIDList')">
												<font color="#FF0000">全部选中</font>
											</td>
											<td align="right">
												<input type="button" name="operFlag1" value="批量删除 "
													onClick="DoOperateDelete()">
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</form>
					<br>
				</td>
			</tr>
		</table>
		<table width="1000" border="0" cellspacing="0" cellpadding="5"
			align="center">
			<tr>
				<td bgcolor="B4B4B4" height="15"></td>
			</tr>
			<tr>
				<td align="center">
					版权所有&reg; 邯郸001. 保留所有权利. 黔ICP备12001966号.
				</td>
			</tr>
		</table>
	</body>
</html>